home *** CD-ROM | disk | FTP | other *** search
/ Champak 29 / Volume 29 - JOGO DISK .iso / Games / jungle_adventure.swf / scripts / __Packages / CommandBox.as < prev    next >
Text File  |  2006-11-29  |  2KB  |  66 lines

  1. class CommandBox extends SSZone
  2. {
  3.    var classID = SSGlobal.CLSID_ZONE;
  4.    var value = -1;
  5.    var localRight = 100;
  6.    var localBottom = 100;
  7.    var command = "LoseLife";
  8.    var editor_isItem = true;
  9.    var editor_name = "CommandBox";
  10.    var editor_args_names = ["width","height","command"];
  11.    var editor_args_values = [CommandBox.prototype.localRight,CommandBox.prototype.localBottom,CommandBox.prototype.command];
  12.    var editor_args_types = ["number","number","string"];
  13.    var editor_args_options = [[10,4000,10],[10,4000,10],"A-Za-z"];
  14.    var editor_args_descriptions = ["","",""];
  15.    var editor_args_mode = [0,0,0];
  16.    var editor_args_component = ["NumericStepper","NumericStepper","TextInput"];
  17.    var editor_canChangeFrame = false;
  18.    function CommandBox(w, h, command)
  19.    {
  20.       super();
  21.       if(w)
  22.       {
  23.          this.localRight = w;
  24.       }
  25.       if(h)
  26.       {
  27.          this.localBottom = h;
  28.       }
  29.       if(command != null)
  30.       {
  31.          this.command = command;
  32.       }
  33.       this.init(SSZone.RECT,new Vector(this.localRight,this.localBottom,0));
  34.    }
  35.    function onCollision(obj)
  36.    {
  37.       return obj.doCommand(this,this.command);
  38.    }
  39.    function onAddDisplay()
  40.    {
  41.    }
  42.    function editor_onCreateDisplay(target, external)
  43.    {
  44.    }
  45.    function editor_onDisplay(target, external)
  46.    {
  47.       target.createTextField("t",20,0,0,100,48);
  48.       var _loc3_ = target.t;
  49.       var _loc4_ = _loc3_.getNewTextFormat();
  50.       _loc4_.size = 20;
  51.       _loc4_.color = 16777215;
  52.       _loc4_.font = "_sans";
  53.       _loc3_.setNewTextFormat(_loc4_);
  54.       _loc3_.selectable = false;
  55.       _loc3_.text = "Command:\n" + this.command;
  56.       target.clear();
  57.       target.lineStyle(0,16742348);
  58.       target.beginFill(16742348,80);
  59.       target.lineTo(this.width,0);
  60.       target.lineTo(this.width,this.height);
  61.       target.lineTo(0,this.height);
  62.       target.lineTo(0,0);
  63.       target.endFill();
  64.    }
  65. }
  66.